package atguigu.demo3

/**
  * Created by lzd on 2018/11/2.
  * stack 栈
  */
object demo3_8 {
  def main(args: Array[String]): Unit = {
    val s = new scala.collection.mutable.Stack[Int]()

    //入栈
    s.push(1)

    //入栈多个元素
    s.push(2, 3, 4)

    //出栈
    s.pop()

    s

    s.push(5)

    //取栈顶元素而不出栈
    s.top

    s

  }
}
